home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / README < prev    next >
Encoding:
Text File  |  1997-03-14  |  34.7 KB  |  920 lines

  1.  
  2.                                  Mesa 2.2
  3.  
  4.                      Copyright (C) 1995-1997  Brian Paul
  5.  
  6.  
  7.  
  8. Disclaimer
  9. ==========
  10.  
  11. Mesa is a 3-D graphics library with an API which is very similar to that
  12. of OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax
  13. or state machine, it is being used with authorization from Silicon Graphics,
  14. Inc.  However, the author makes no claim that Mesa is in any way a
  15. compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
  16. Those who want a licensed implementation of OpenGL should contact a licensed
  17. vendor.  This software is distributed under the terms of the GNU Library
  18. General Public License, see the LICENSE file for details.
  19.  
  20. * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  21.  
  22.  
  23.  
  24. Author
  25. ======
  26.  
  27. Brian Paul
  28. Avid Technology
  29. 6400 EnterPrise Lane, Suite 201
  30. Madison, WI  53719
  31.  
  32. brianp@elastic.avid.com
  33.  
  34. Formerly employed at the Space Science and Engineering Center at the
  35. University of Wisconsin - Madison.
  36.  
  37.  
  38.  
  39. Introduction
  40. ============
  41.  
  42. While Mesa uses the OpenGL API and mimics its semantics, it is
  43. important to understand that Mesa is not a real implementation of OpenGL
  44. since it is not licensed and has not been tested by the OpenGL conformance
  45. tests.  That said, Mesa is still a viable alternative to OpenGL.
  46.  
  47. Since version 2.0 Mesa implements the OpenGL 1.1 API specification.
  48. Only a few features are not yet implemented:
  49.  
  50.     trimmed NURBS
  51.     line and polygon antialiasing
  52.     glGetPolygonStipple function
  53.     glGetTexImage
  54.  
  55.  
  56. The primary design goal of this library has been correctness.  Common
  57. code paths are optimized for speed.  If you find that a particular
  58. rendering operation is slow let me know about it.  It may be a simple
  59. matter to optimize the operation in question.
  60.  
  61. I've been working on this library in my spare time since August, 1993.
  62. The core library was originally written on an Amiga using the DCC compiler.
  63. Later, development was moved to an SGI workstation.  Current development
  64. is done on SGI and PC/Linux systems.
  65.  
  66. Mesa works on most Unix workstations with ANSI C and X11.  There are also
  67. drivers for Amiga, Microsoft Windows, Macintosh, MS DOS, NeXT, and BeOS
  68. systems.  Look below for more information.
  69.  
  70. Since the OpenGL API is used, OpenGL documentation can serve as the
  71. documentation for Mesa's core functions.  Here are a few sources:
  72.  
  73.   WWW Center:   http://www.sgi.com/Technology/openGL/
  74.   Man pages:    http://www.digital.com:80/pub/doc/opengl/
  75.   Spec doc:     http://www.sgi.com/Technology/openGL/glspec/glspec.html
  76.  
  77.  
  78.  
  79. Getting the software
  80. ====================
  81.  
  82. The primary Mesa ftp site is iris.ssec.wisc.edu in the pub/Mesa directory.
  83. Mesa is also mirrored on sunsite in the directory pub/packages/development
  84. /graphics/mesa.
  85.  
  86.  
  87. The archive file Mesa-2.2.tar.Z can be unpacked with:
  88.     zcat Mesa-2.2.tar.Z | tar xf -
  89.  
  90. The archive file Mesa-2.2.tar.gz can be unpacked with:
  91.     gzcat Mesa-2.2.tar.gz | tar xf -
  92.  
  93. The archive file Mesa-2.2.zip can be unpacked with:
  94.     unzip Mesa-2.2.zip
  95.  
  96.  
  97. After you unpacking you should have the following files in the Mesa-2.2
  98. directory:
  99.  
  100. README        - this file
  101. README.AMIWIN    - instructions for using Mesa on Amigas with AmiWin (X11)
  102. README.GLUT    - instructions for using Mesa with GLUT
  103. README.OS2    - instructions for using Mesa with OS/2 and XFree86
  104. README.DOS    - instructions for using Mesa with MS-DOS
  105. README.VMS    - instructions for using Mesa with VMS
  106. LICENSE        - the GNU library license
  107. IAFA-PACKAGE    - description file
  108. VERSIONS    - version history
  109. Makefile    - top-level Makefile
  110. Make-config    - system configurations used by the Makefiles
  111. Imakefile    - for OS/2
  112. mklib.*        - shell scripts for making shared libraries for some systems
  113. include/    - client include files
  114. lib/        - client libraries, created during installation
  115. src/        - source code for core library
  116. src-glu/    - source code for utility library
  117. src-tk/        - source code for tk library
  118. src-aux/    - source code for aux library
  119. demos/        - demo programs
  120. samples/    - sample OpenGL programs from SGI
  121. book/        - example programs from the OpenGL Programming Guide
  122. util/        - handly utility functions
  123. widgets-mesa/    - Mesa widgets for Xt/Motif
  124. widgets-sgi/    - SGI OpenGL widgets for Xt/Motif
  125. windows/    - Microsoft Windows driver stuff, from Mesa 1.2.x
  126. NeXT/        - NeXT demo programs
  127. BeOS/        - BeOS demo programs
  128. mondello/    - Cirrus Logic Mondello 3-D accelerator code
  129. *mms*        - makefiles for VMS
  130. OpenStep/    - OpenStep files
  131. mesa3dfx/    - David Bucciarelli's 3Dfx code
  132.  
  133.  
  134.  
  135.  
  136. Installation for Unix/X11
  137. =========================
  138.  
  139. To compile the library, first type 'make' alone to see the list of system
  140. configurations currently supported.  If you see your configuration on the
  141. list, type 'make <config>'.  Most popular Unix/X workstations are currently
  142. supported.
  143.  
  144. The top-level makefile will execute the makefiles in a number of sub-
  145. directories.  When finished, there should be executables in the "demos/",
  146. "samples/", and "book/" directories for you to try out.  If you only want
  147. to compile the contents of one subdirectory you can 'cd' to that directory
  148. and type 'make <config>' there.  For example, to just compile the main
  149. Mesa library:  cd src ; make <config>
  150.  
  151. If your system configuration is not listed by 'make', you'll have to modify
  152. the top-level Makefile and Make-config files.  There are instructions in
  153. each file.
  154.  
  155. If you have compilation problems you should try to fix them and return the
  156. patches to the author.
  157.  
  158.  
  159. Header and library files:
  160.    After you've compiled Mesa and tried the demos I recommend the following
  161.    procedure for "installing" Mesa.
  162.  
  163.    Copy the Mesa include/GL directory to /usr/local/include:
  164.     cp -r include/GL /usr/local/include
  165.  
  166.    Copy the Mesa library files to /usr/local/lib:
  167.     cp lib/* /usr/local/lib
  168.  
  169.    Create a few symbolic links so that compiling OpenGL applications is easy:
  170.     cd /usr/local/lib
  171.     IF USING STATIC (lib*.a) FILES THEN
  172.         ln -s libMesaGL.a libGL.a
  173.         ln -s libMesaGLU.a libGLU.a
  174.     ELSE
  175.         ln -s libMesaGL.so libGL.so
  176.         ln -s libMesaGLU.so libGLU.so
  177.     ENDIF
  178.  
  179.  
  180. Xt/Motif widgets:
  181.    If you want to use Mesa or OpenGL in your Xt/Motif program you can build
  182.    the widgets found in either the widgets-mesa or widgets-sgi directories.
  183.    The former were written for Mesa and the later are the original SGI
  184.    widgets.  Look in those directories for more information.
  185.  
  186.  
  187. Notes:
  188.    HP users:  a Mesa user reports that the HP-UX 10.01 C compiler has
  189.    a bug which effects glReadPixels.  A patch for the compiler (PHSS_5743) is
  190.    available.  Otherwise be sure your compiler is version 10.13 or later.
  191.  
  192.    QNX users:  if you have problems running the demos try setting the
  193.    stack size to 200K or larger with -N200K, for example.
  194.  
  195.    SunOS 5.x users:  The X shared memory extension may not work
  196.    correctly.  If Mesa prints an error message to the effect of "Shared memory
  197.    error" then you'll have to append the following three lines to the end of
  198.    your /etc/system file then reboot:
  199.       set shmsys:shminfo_shmmax = 0x2000000
  200.       set shmsys:shminfo_shmmni = 0x1000
  201.       set shmsys:shminfo_shmseg = 0x100
  202.  
  203.  
  204.  
  205. Installation for Amigas
  206. =======================
  207.  
  208. See http://www.efd.lth.se/~d94sz/amesa for the latest version of the Amiga
  209. driver.
  210.  
  211.  
  212.  
  213. Installation for Microsoft Windows
  214. ==================================
  215.  
  216. See the windows/README file for more information.
  217.  
  218.  
  219.  
  220. Installation for Macintosh
  221. ==========================
  222.  
  223. From ftp://iris.ssec.wisc.edu/pub/Mesa/contrib download these files:
  224.     mesa0.31b.sit.hqx
  225.     GLUT4Mac.sit.hqx
  226.  
  227.  
  228.  
  229. Installation for NeXT
  230. =====================
  231.  
  232. Simply typing "make next" should compile Mesa and a number of NeXT demo
  233. programs found in the NeXT/ directory.  The NeXT driver is implemented
  234. through Mesa's Off-Screen rendering interface.
  235.  
  236.  
  237.  
  238. Installation for BeOS
  239. =====================
  240.  
  241. Simply typing "make beos" should compile Mesa and a number of BeOS demo
  242. programs found in the BeOS/ directory.  The BeOS driver is implemented
  243. through Mesa's Off-Screen rendering interface.
  244.  
  245.  
  246.  
  247. Installation for OS/2
  248. =====================
  249.  
  250. *** Mesa 2.x does not currently work on OS/2 ***
  251.  
  252. See the README.OS2 file for details.
  253.  
  254.  
  255.  
  256. Installation for VMS
  257. ====================
  258.  
  259. See the README.VMS file for more information.
  260.  
  261.  
  262.  
  263. Installation for MS-DOS
  264. =======================
  265.  
  266. See the README.DOS file for more information.
  267.  
  268.  
  269.  
  270. Installation for OpenStep
  271. =========================
  272.  
  273. See the OpenStep/README file for more information.
  274.  
  275.  
  276.  
  277. Using the library
  278. =================
  279.  
  280. Configuration options:
  281.    The file src/config.h has many parameters which you can adjust such
  282.    as maximum number of lights, clipping planes, maximum texture size,
  283.    etc.  In particular, you may want to change DEPTH_BITS from 16 to 32
  284.    if a 16-bit depth buffer isn't precise enough for your application.
  285.  
  286.  
  287. Shared libraries:
  288.    If you compile shared libraries you may have to set an environment
  289.    variable to specify where the Mesa libraries are located.  On Linux and
  290.    Sun systems for example, set the LD_LIBRARY_PATH variable to include
  291.    /your-dir/Mesa-2.2/lib.   Otherwise, when you try to run a demo it
  292.    may fail with a message saying that one or more libraries couldn't be
  293.    found.
  294.  
  295.  
  296. Remote display of OpenGL/GLX programs:
  297.    As of version 1.2.3, Mesa's header files use the same GLenum and GLUenum
  298.    values as SGI's (and most/all other vendor's) OpenGL headers.  This means
  299.    you can freely mix object files compiled with OpenGL or Mesa headers.
  300.    In fact, on systems with dynamic runtime linkers it's possible to dynam-
  301.    ically link with Mesa or OpenGL shared libraries at runtime, without
  302.    recompiling or relinking anything!
  303.  
  304.    Using IRIX 5.x as an example, you can run SGI's OpenGL demos with the
  305.    Mesa shared libraries as follows.  Let's assume you're installing Mesa
  306.    in /usr/local/Mesa and using the C-shell:
  307.        % cd /usr/local/Mesa
  308.        % make irix5-dso
  309.        % cd lib
  310.        % ln -s libMesaGL.so libGL.so
  311.        % setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT"
  312.        % /usr/demos/bin/ideas_ogl      // this is a test
  313.  
  314.    You can now run OpenGL executables on almost any X display!  There may
  315.    be some problems from the fact that Mesa supports many X visual types
  316.    that an OpenGL client may not expect (grayscale for example).  In this
  317.    case the application may abort, print error messages, or just behave
  318.    strangely.  You may have to experiment with the MESA_RGB_VISUAL envi-
  319.    ronment variable.
  320.  
  321.  
  322. Toolkits (X11 only):
  323.    Mesa includes the glaux and gltk libraries from SGI.  Their only real
  324.    use is for writing simple demo programs.  It is highly recommended that
  325.    you do _not_ use these libraries for your own programs.  There are
  326.    several alternatives:
  327.  
  328.       1. GLUT (OpenGL Utility Toolkit) was written by Mark Kilgard of SGI
  329.       as a replacement for glaux and gltk.  It provides a simple, portable,
  330.       window-system independent interface allowing you to write OpenGL
  331.       applications quickly and easily.  GLUT isn't included with Mesa but
  332.       you'll find instructions on how to get and build GLUT in the file
  333.       README.GLUT.  The second edition of the OpenGL Programming Guide,
  334.       published by Addison Wesley uses GLUT instead of the glaux library.
  335.  
  336.       2. Use an Xt/Motif widget.  Look in the widgets-old/ or widgets-sgi
  337.       directories for more info.
  338.  
  339.       3. If you use Tcl/Tk you should consider Togl.  See
  340.       http://www.ssec.wisc.edu/~brianp/Togl.html for more information.
  341.  
  342.       4. Use the GLX (simulated since Mesa doesn't implement the GLX proto-
  343.       col) functions.  These functions look like, and try to act like, the
  344.       real GLX functions used by OpenGL in conjunction with the X window
  345.       system.
  346.  
  347.  
  348. Performance tips:
  349.    1. Turn off smooth shading when you don't need it (glShadeModel)
  350.    2. Turn off depth buffering when you don't need it.
  351.    3. Turn off dithering when not needed.
  352.    4. Use double buffering as it's often faster than single buffering
  353.    5. Compile in the X Shared Memory extension option if it's supported
  354.       on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
  355.       your system in the Make-config file.
  356.    6. Recompile Mesa with more optimization if possible.
  357.    7. Try to maximize the amount of drawing done between glBegin/glEnd pairs.
  358.    8. Use the MESA_BACK_BUFFER variable to find best performance in double
  359.       buffered mode.  (X users only)
  360.    9. Optimized polygon rasterizers are employed when:
  361.          rendering into back buffer which is an XImage
  362.          RGB mode, not grayscale, not monochrome
  363.          depth buffering is GL_LESS, or disabled
  364.          flat or smooth shading
  365.          dithered or non-dithered
  366.          no other rasterization operations enabled (blending, stencil, etc)
  367.   10. Optimized line drawing is employed when:
  368.          rendering into back buffer which is an XImage
  369.          RGB mode, not grayscale, not monochrome
  370.          depth buffering is GL_LESS or disabled
  371.          flat shading
  372.          dithered or non-dithered
  373.          no other rasterization operations enabled (blending, stencil, etc)
  374.   11. Textured polygons are fastest when:
  375.          using a 3-component (RGB), 2-D texture
  376.          minification and magnification filters are GL_NEAREST
  377.          texture coordinate wrap modes for S and T are GL_REPEAT
  378.          GL_DECAL environment mode
  379.          glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
  380.          depth buffering is GL_LESS or disabled
  381.   12. Lighting is fastest when:
  382.          Two-sided lighting is disabled
  383.          GL_LIGHT_MODEL_LOCAL_VIEWER is false
  384.          GL_COLOR_MATERIAL is disabled
  385.          No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
  386.          No local lights are used (all position W's are 0.0)
  387.          All material and light coefficients are >= zero
  388.   13. XFree86 users:  if you want to use 24-bit color try starting your
  389.       X server in 32-bit per pixel mode for better performance.  That is,
  390.       start your X server with
  391.          startx -- -bpp 32
  392.       instead of
  393.          startx -- -bpp 24
  394.  
  395.  
  396. Debugging:
  397.    Normally Mesa records but does not notify the user of errors.  It is up
  398.    to the application to call glGetError to check for errors.  Mesa supports
  399.    an environment variable, MESA_DEBUG, to help with debugging.  If MESA_DEBUG
  400.    is defined, a message will be printed to stdout whenever an error occurs.
  401.  
  402.    More extensive error checking is done when Mesa is compiled with the
  403.    DEBUG symbol defined.  You'll have to edit the Make-config file and
  404.    add -DDEBUG to the CFLAGS line for your system configuration.  You may
  405.    also want to replace any optimization flags with the -g flag so you can
  406.    use your debugger.  After you've edited Make-config type 'make clean'
  407.    before recompiling.
  408.  
  409.    In your debugger you can set a breakpoint in gl_error() to trap Mesa
  410.    errors.
  411.  
  412.    There is a display list printing/debugging facility.  See the end of
  413.    src/dlist.c for details.
  414.  
  415.  
  416. X Display Modes:
  417.    Mesa supports rendering in most X visual types and depths.  When a
  418.    TrueColor or DirectColor visual isn't available dithering is used in RGB
  419.    mode.
  420.  
  421.    The glXChooseVisual function tries its best to pick an appropriate visual
  422.    for the given attribute list.  However, if this doesn't suit your needs
  423.    you can force Mesa to use any X visual you want (any supported by your
  424.    X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
  425.    environment variables.  When an RGB visual is requested, glXChooseVisual
  426.    will first look if the MESA_RGB_VISUAL variable is defined.  If so, it
  427.    will try to use the specified visual.  Similarly, when a color index
  428.    visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
  429.    variable.
  430.  
  431.    The format of accepted values is:  <visual-class> <depth>
  432.    Here are some examples:
  433.  
  434.    using the C-shell:
  435.     % setenv MESA_RGB_VISUAL "TrueColor 8"        // 8-bit TrueColor
  436.     % setenv MESA_CI_VISUAL "PseudoColor 12"    // 12-bit PseudoColor
  437.     % setenv MESA_RGB_VISUAL "PseudoColor 8"    // 8-bit PseudoColor
  438.  
  439.    using the KornShell:
  440.     $ export MESA_RGB_VISUAL="TrueColor 8"
  441.     $ export MESA_CI_VISUAL="PseudoColor 12"
  442.     $ export MESA_RGB_VISUAL="PseudoColor 8"
  443.  
  444.  
  445. Double buffering (X11 only):
  446.    Mesa can use either an X Pixmap or XImage as the backbuffer when in
  447.    double buffer mode.  Using GLX, the default is to use an XImage.  The
  448.    MESA_BACK_BUFFER environment variable can override this.  The valid
  449.    values for MESA_BACK_BUFFER are:  Pixmap and XImage (only the first
  450.    letter is checked, case doesn't matter).
  451.  
  452.    A pixmap is faster when drawing simple lines and polygons while an
  453.    XImage is faster when Mesa has to do pixel-by-pixel rendering.  If you
  454.    need depth buffering the XImage will almost surely be faster.  Exper-
  455.    iment with the MESA_BACK_BUFFER variable to see which is faster for
  456.    your application.  
  457.  
  458.  
  459. Colormaps (X11 only):
  460.    When using Mesa directly or with GLX, it's up to the application writer
  461.    to create a window with an appropriate colormap.  The aux, tk, and GLUT
  462.    toolkits try to minimize colormap "flashing" by sharing colormaps when
  463.    possible.  Specifically, if the visual and depth of the window matches
  464.    that of the root window, the root window's colormap will be shared by
  465.    the Mesa window.  Otherwise, a new, private colormap will be allocated.
  466.  
  467.    When sharing the root colormap, Mesa may be unable to allocate the colors
  468.    it needs, resulting in poor color quality.  This can happen when a
  469.    large number of colorcells in the root colormap are already allocated.
  470.    To prevent colormap sharing in aux, tk and GLUT, define the environment
  471.    variable MESA_PRIVATE_CMAP.  The value isn't significant.
  472.  
  473.  
  474. Fortran bindings:
  475.    Fortan bindings are no longer included with Mesa.  William F. Mitchell
  476.    (william.mitchell@nist.gov) has developed a new set of Mesa/OpenGL and
  477.    GLUT bindings for Fortran.  See http://math.nist.gov/f90gl for more
  478.    information.
  479.  
  480.  
  481. Gamma correction (X11 only):
  482.    To compensate for the nonlinear relationship between pixel values
  483.    and displayed intensities, there is a gamma correction feature in
  484.    Mesa.  Some systems, such as Silicon Graphics, support gamma
  485.    correction in hardware (man gamma) so you won't need to use Mesa's
  486.    gamma facility.  Other systems, however, may need gamma adjustment
  487.    to produce images which look correct.  If in the past you thought
  488.    Mesa's images were too dim, read on.
  489.  
  490.    Gamma correction is controlled with the MESA_GAMMA environment
  491.    variable.  Its value is of the form "Gr Gg Gb" or just "G" where
  492.    Gr is the red gamma value, Gg is the green gamma value, Gb is the
  493.    blue gamma value and G is one gamma value to use for all three
  494.    channels.  Each value is a positive real number typically in the
  495.    range 1.0 to 2.5.  The defaults are all 1.0, effectively disabling
  496.    gamma correction.  Examples using csh:
  497.  
  498.     % setenv MESA_GAMMA "2.3 2.2 2.4"    // separate R,G,B values
  499.     % setenv MESA_GAMMA "2.0"        // same gamma for R,G,B
  500.  
  501.    The demos/gamma.c program may help you to determine reasonable gamma
  502.    value for your display.  With correct gamma values, the color intensities
  503.    displayed in the top row (drawn by dithering) should nearly match those
  504.    in the bottom row (drawn as grays).
  505.  
  506.    Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
  507.    on HP displays using the HP-ColorRecovery technology.
  508.  
  509.    Mesa implements gamma correction with a lookup table which translates
  510.    a "linear" pixel value to a gamma-corrected pixel value.  There is a
  511.    small performance penalty.  Gamma correction only works in RGB mode.
  512.    Also be aware that pixel values read back from the frame buffer will
  513.    not be "un-corrected" so glReadPixels may not return the same data
  514.    drawn with glDrawPixels.
  515.  
  516.    For more information about gamma correction see:
  517.    http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
  518.  
  519.  
  520. Off-screen rendering:
  521.    Mesa 1.2.4 introduced off-screen rendering, a facility for generating
  522.    3-D imagery without having to open a window on your display.  Mesa's
  523.    simple off-screen rendering interface is completely operating system
  524.    and window system independent so programs which use off-screen rendering
  525.    should be very portable.  This new feature effectively enables you to
  526.    use Mesa as an off-line, batch-oriented renderer.
  527.  
  528.    The "OSMesa" API provides 3 functions for making off-screen renderings:
  529.    OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext().
  530.    See the Mesa/include/GL/osmesa.h header for more information.  See the
  531.    demos/osdemo.c file for an example program.   There is no facility for
  532.    writing images to files.
  533.  
  534.    If you want to generate large images (larger than 1280x1024) you'll
  535.    have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
  536.    then recompile Mesa.  Image size should only be limited by available
  537.    memory.
  538.  
  539.  
  540. Profiling:
  541.    Mesa 1.2.6 introduced a simple profiling facility.  It counts and
  542.    measures the time spent in a number of important rendering operations
  543.    and prints the information in a report before your program exits.
  544.  
  545.    By default, profiling is disabled.  To enable it, add -DPROFILE to
  546.    the appropriate CFLAGS entry in the Make-config file, then recompile
  547.    Mesa.  In general, you should only enable profiling during program
  548.    development to gain insight into Mesa's performance.  Mesa runs a bit
  549.    slower when profiling is enabled because it requires frequent polling
  550.    of the system clock.
  551.  
  552.    The profiling report will be printed when glXDestroyContext is called
  553.    _if_ the MESA_PROFILE environment variable is set.  You must be sure
  554.    glXDestroyContext is called before exiting to get the profile report.
  555.    The report will be printed to stdout and includes:
  556.  
  557.       glBegin/glEnd - number of glBegin/glEnd pairs called, total time,
  558.          and rate in pairs/second.
  559.       vertexes transformed - number of vertices transformed, lit, clip-
  560.          tested, fogged, and mapped to window coordinates, total time,
  561.          and rate in vertexes/second.
  562.       points rasterized - number of points drawn, time, and rate.
  563.       lines rasterized - number of lines drawn, time, and rate.
  564.       polygons rasterized - number of polygons drawn, time and rate.
  565.       overhead - time between glBegin/glEnd not accounted for by vertexes,
  566.          points, lines, and polygons.  This is time spent executing
  567.          glVertex, glNormal, glColor, etc, clipping, primitive assembly,
  568.          and user code between glBegin/glEnd.
  569.       glClear - number of glClears executed, total time and clears/second.
  570.       SwapBuffers - number of swaps executed, total time and swaps/second.
  571.  
  572.    Note that the real point, line, and polygon rates should be computed by
  573.       adding in the vertex transformation and overhead time factors.
  574.  
  575.  
  576. Linux SVGA driver:
  577.    Mesa 1.2.6 has a preliminary Linux SVGA driver for Mesa.  It's based
  578.    on the SVGA library included with Linux.  The driver isn't finished
  579.    yet.  I'm not too familiar with SVGA graphics so I could use some help
  580.    finishing it.  Contact Brian if you want to help.
  581.  
  582.    To enable the SVGA driver, edit the Make-config file and add -DSVGA to
  583.    the CFLAGS for Linux and add -lvga to the LIBS variable.  There are
  584.    several test programs (vtest.c, vgears.c, vindex.c) in the demos
  585.    directory.  See the include/GL/svgamesa.h and src/svgamesa.c files for
  586.    more information about the driver.
  587.  
  588.  
  589. Extensions:
  590.    The following OpenGL extensions are currently implemented:
  591.  
  592.       GL_EXT_blend_color - allows blending with a constant color
  593.       GL_EXT_blend_minmax - blend min/max operator
  594.       GL_EXT_blend_logic_op - allows glLogicOp to work in RGBA mode
  595.       GL_EXT_blend_subtract - blend subtraction operator
  596.       GL_EXT_vertex_array - vertex array extension
  597.       GLX_EXT_visual_info - GLX visual and transparent pixel extension
  598.  
  599.    For detailed information about the extensions see:
  600.       ftp://sgigate.sgi.com/pub/opengl/extensions/
  601.  
  602.    There are four Mesa-specific GL/GLX extensions at this time.
  603.  
  604.    GLX_MESA_pixmap_colormap 
  605.  
  606.       This extension adds the GLX function:
  607.  
  608.          GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  609.                                            Pixmap pixmap, Colormap cmap )
  610.  
  611.       It is an alternative to the standard glXCreateGLXPixmap() function.
  612.       Since Mesa supports RGB rendering into any X visual, not just True-
  613.       Color or DirectColor, Mesa needs colormap information to convert RGB
  614.       values into pixel values.  An X window carries this information but a
  615.       pixmap does not.  This function associates a colormap to a GLX pixmap.
  616.       See the demos/glxpixmap.c file for an example of how to use this
  617.       extension.
  618.  
  619.    GLX_MESA_release_buffers
  620.  
  621.       Mesa associates a set of ancillary (depth, accumulation, stencil and
  622.       alpha) buffers with each X window it draws into.  These ancillary
  623.       buffers are allocated for each X window the first time the X window
  624.       is passed to glXMakeCurrent().  Mesa, however, can't detect when an
  625.       X window has been destroyed in order to free the ancillary buffers.
  626.  
  627.       The best it can do is to check for recently destroyed windows whenever
  628.       the client calls the glXCreateContext() or glXDestroyContext()
  629.       functions.  This may not be sufficient in all situations though.
  630.  
  631.       The GLX_MESA_release_buffers extension allows a client to explicitly
  632.       deallocate the ancillary buffers by calling glxReleaseBuffersMESA()
  633.       just before an X window is destroyed.  For example:
  634.  
  635.          #ifdef GLX_MESA_release_buffers
  636.             glXReleaseBuffersMESA( dpy, window );
  637.          #endif
  638.          XDestroyWindow( dpy, window );
  639.  
  640.       This extension is new in Mesa 2.0.
  641.  
  642.    GL_MESA_window_pos
  643.  
  644.       This extension adds the glWindowPos*MESA() functions.  These functions
  645.       are convenient alternatives to glRasterPos*() because they set the
  646.       current raster position to a specific window coordinate, bypassing the
  647.       usual modelview, projection and viewport transformations.  This is
  648.       especially useful for setting the position for glDrawPixels() or
  649.       glBitmap() to a specific window coordinate.
  650.  
  651.       X and Y parameters (positive and negative) are directly mapped to
  652.       window coordinates.  Z is a depth value clamped to the range [0,1].
  653.       W is directly mapped.  The current raster position valid flag is
  654.       always set to true.  The current raster distance is set to zero.
  655.       The current raster color and texture coordinate are updated in the
  656.       same manner as glRasterPos().  In selection mode a hit record is
  657.       always generated.
  658.  
  659.       Programs using OpenGL, not Mesa, may also use the glWindowPos*MESA()
  660.       functions by including winpos.h from the src directory and by
  661.       compiling and linking with the winpos.c file from the src directory.
  662.  
  663.    GL_MESA_resize_buffers
  664.  
  665.       This extension adds the glResizeBuffersMESA() function.  When this
  666.       function is called, Mesa checks if the color buffer (window) has
  667.       been resized.  If it has, Mesa reallocates the ancillary (depth,
  668.       stencil, accum) buffers.
  669.  
  670.       Normally, Mesa checks for window size changes whenever glViewport()
  671.       is called.  In some applications it may not be appropriate to call
  672.       glViewport() when the window is resized.  Such applications should
  673.       call glResizeBuffersMESA() instead so the ancillary buffers are
  674.       correctly updated.
  675.  
  676.       This extension is new in version 2.2.
  677.  
  678.  
  679. Version 2.x features:
  680.    Version 2.x of Mesa implements the OpenGL 1.1 API.  The following
  681.    functions are new in Mesa 2.x:
  682.  
  683.    Texture mapping:
  684.     glAreTexturesResident
  685.     glBindTexture
  686.     glCopyTexImage1D
  687.     glCopyTexImage2D
  688.     glCopyTexSubImage1D
  689.     glCopyTexSubImage2D
  690.     glDeleteTextures
  691.     glGenTextures
  692.     glIsTexture
  693.     glPrioritizeTextures
  694.     glTexSubImage1D
  695.     glTexSubImage2D
  696.  
  697.    Vertex Arrays:
  698.     glArrayElement
  699.     glColorPointer
  700.     glDrawElements
  701.     glEdgeFlagPointer
  702.     glIndexPointer
  703.     glInterleavedArrays
  704.     glNormalPointer
  705.     glTexCoordPointer
  706.     glVertexPointer
  707.  
  708.    Client state management:
  709.     glDisableClientState
  710.     glEnableClientState
  711.     glPopClientAttrib
  712.     glPushClientAttrib
  713.  
  714.    Misc:
  715.     glGetPointer
  716.     glIndexub
  717.     glIndexubv
  718.     glPolygonOffset
  719.  
  720.  
  721. Summary of environment variables:
  722.    MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
  723.    MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
  724.    MESA_BACKBUFFER - specifies how to implement the back color buffer (X only)
  725.    MESA_DEBUG - if defined, error messages are printed to stderr
  726.    MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
  727.    MESA_GAMMA - gamma correction coefficients (X only)
  728.    MESA_PROFILE - enable reporting of performance measurements
  729.    MESA_XSYNC - enable synchronous X behavior (for debugging only)
  730.  
  731.  
  732.  
  733. Mailing List
  734. ============
  735.  
  736. There is a Mesa mailing list.  Its purpose is to let Mesa users exchange
  737. any ideas, questions, and/or problems they have.  To subscribe, send the
  738. following message to the address mesa-request@iqm.unicamp.br
  739.  
  740.     add yourname@your.internet.address mesa
  741.  
  742. For example:
  743.  
  744.     add brianp@elastic.avid.com mesa
  745.  
  746. You will receive a welcome message from the list server when you have been
  747. added to the list.
  748.  
  749. To unsubscribe from the list send the following message to
  750. mesa-request@iqm.unicamp.br
  751.  
  752.     del yourname@your.internet.address mesa
  753.  
  754. Thanks to Pedro Vazquez (vazquez@iqm.unicamp.br) for setting up and
  755. maintaing the list.
  756.  
  757.  
  758.  
  759. WWW Page
  760. ========
  761.  
  762. There is a Mesa WWW page:  http://www.ssec.wisc.edu/~brianp/Mesa.html
  763.  
  764.  
  765.  
  766. Contributed code
  767. ================
  768.  
  769. There is a contrib/ subdirectory on the Mesa ftp site which contains
  770. contributions from Mesa users.  See the README file in that directory for
  771. more information.
  772.  
  773. Anyone is welcome to contribute code to the Mesa project, provided you
  774. agree to the GNU license.
  775.  
  776.  
  777.  
  778. Reporting Bugs
  779. ==============
  780.  
  781. If you think you've found a bug in Mesa first check if a newer version of
  782. Mesa is available.  Next, check ftp://iris.ssec.wisc.edu/pub/Mesa to see
  783. if a patch for your bug is there.  Otherwise, report the problem.
  784.  
  785. Since many people have contributed code to Mesa it's important that you
  786. report a bug to the right person:
  787.  
  788. Area            Contact
  789. ----------------------    -------------------------------------------
  790. GLU polygon tessellator    Bogdan Sikorski  bogdan@cira.it
  791. GLU NURBS        Bogdan Sikorski  bogdan@cira.it
  792. Evaluators        Bernd Barsuhn  bernd@berlin.muc.de
  793. Xt/Motif widgets    Thorsten Ohl  ohl@crunch.ikp.physik.th-darmstadt.de
  794.               and Jeroen van der Zijp  jvz@cyberia.cfdrc.com
  795. Fortran bindings    William Mitchell  william.mitchell@nist.gov
  796. Amiga driver        Stefan Zivkovic  d94sz@efd.lth.se
  797. Amiwin driver        Victor Ng-Thow-Hing  victorng@dgp.toronto.edu
  798. Macintosh driver    Miklos Fazekas  boga@augusta.elte.hu
  799. NeXT driver        Pascal Thibaudeau pthibaud@frbdx11.cribx1.u-bordeaux.fr
  800. OS/2 driver        Darren Abbott  abbott@hiwaay.net
  801. VMS support        Jouk Jansen  joukj@crys.chem.uva.nl
  802. Windows 95/NT driver    Li Wei  liwei@aiar.xjtu.edu.cn
  803. MS-DOS driver        Charlie Wallace  cwallace@dreamworks.com
  804. BeOS driver        Tinic Uro  5uro@informatik.uni-hamburg.de
  805. GLX encoder/decoder    Steven Parker  sparker@taz.cs.utah.edu
  806. 3Dfx driver        David Bucciarelli  tech.hmw@plus.it
  807. Mailing list help    Pedro Vazquez  vazquez@iqm.unicamp.br
  808.  
  809. EVERYTHING ELSE-->    Brian Paul  brianp@elastic.avid.com
  810.  
  811. Feel free to cc Brian on messages sent to anyone listed above.  None of
  812. the people on this list are under any obligation to respond to bug reports.
  813. However, they have been pretty helpful so far.
  814.  
  815. When you report a bug please give as much information as possible including
  816. your hardware/software environment, which version of Mesa you're using, how
  817. to reproduce the problem, and if possible, a test program.
  818.  
  819.  
  820.  
  821. Known Bugs
  822. ==========
  823.  
  824. 1. Evaluator automatic normal vectors are miscalculated under certain
  825.    conditions.
  826.  
  827. 2. glCopyPixels gives undefined results when source and destination regions
  828.    overlap and pixel zoom!=1.0.
  829.  
  830. 3. Mesa doesn't work too well on Crays.  The problem is that Crays do not
  831.    have the exact C data type sizes which Mesa's X driver relies on.  Better
  832.    Cray support may or may not be seen in the future.
  833.  
  834. 4. gluCylinder, and probably other GLU quadrics, don't generate texture
  835.    coordinates when drawing in point or line mode.
  836.  
  837. 5. The texture mapping lambda calculation doesn't seem to be 100%
  838.    correct.  This is only significant when the texture minification and
  839.    magnification filters are different.
  840.  
  841.  
  842.  
  843. Future Plans
  844. ============
  845.  
  846. 1. Display list optimization:  scan for duplicate vertices and normals in
  847.    order to reduce number of transformations needed.
  848.  
  849. 2. Implement a "generational" depth buffer which only has to be cleared
  850.    once every 'n' frames.
  851.  
  852. 3. Integrate Mesa into the XFree86 X server.
  853.  
  854. 4. Support 3-D graphics hardware.
  855.  
  856.  
  857.  
  858. Why is it the library called Mesa?
  859. ==================================
  860.  
  861. Why not?  More obvious names were considered but had to be rejected:
  862. FreeGL (too similar to the trademarked name OpenGL), Free3D (too similar
  863. to DEC's Open3D).  Also, I'm tired of acronyms.
  864.  
  865. [I've recently discovered that at least two other software products use the
  866. name Mesa.  A name change may be necessary in the future.  Suggestions are
  867. welcome!]
  868.  
  869.  
  870.  
  871. Contributors
  872. ============
  873.  
  874. Many people have contributed to Mesa.  I really appreciate the help!
  875. Among the contributors are:
  876.  
  877. Erich Stefan Boleyn - for the glRotate code and testing early Mesa
  878. Joe Kiniry, Kendall Bennett - for opinions and discussion
  879. Marc Buffat - for the gluProject and gluUnproject functions
  880. Bernd Barsuhn, Volker Weiss - for the new implementation of evaluators
  881. Philip Brown - for the initial GLX, GLUT implementation
  882. Thorsten Ohl - for glXUseXFont() and glBitmap bug fixes
  883. Thomas Malik - for new invert_matrix and other xform.c code
  884. Michael Pichler - for X colormap code and numerous bug reports/fixes
  885. Thorsten Ohl, Jeroen van der Zijp - for the Xt/Motif widgets
  886. Bob Mercier - for the new 8-bit RGB dithering code
  887. Pedro Vazquez - for establishing the Mesa mailing list
  888. Bogdan Sikorski - for the GLU polygon tessellation code and NURBS
  889. Linas Vepstas - for his extrusion and swept surface library
  890. Frederic Devernay - for improved X shared memory support
  891. Asif Khan - for bringing _many_ subtle bugs to my attention
  892. Mark Peterson - for the MS Windows driver for Mesa
  893. Gene Lett and Kerris Renkin - for diagnosing several rasterization problems
  894. Alex De Bruyn - for HP Color Recovery display support
  895. Miklos Fazekas - for the Macintosh driver
  896. Frederic Devernay - for many Sun configs and lots of useful feedback
  897. Victor Ng-Thow-Hing - for the Amiga AmiWin port
  898. Bill Triggs - improved texture mapping features
  899. Martin Bernhard - added texture coordinate generation to GLU quadric functions
  900. Pascal Thibaudeau - NeXT support
  901. Jean-Luc Daems, Jacques Leroy - numerous optimization in Mesa 1.2.7
  902. Joerg Hessdoerfer - 16-bit TrueColor optimizations in Mesa 1.2.7
  903. Stefan Zivkovic - for the Amiga driver
  904. Peter McDermott - for the Cirrus Logic Mondello driver
  905. Constantin Filin - for mipmapping/texture mapping code
  906. Darren Abbott - for the OS/2 XFree86 port
  907. Hal Brand - for X line and polygon stippling code
  908. Eric Berdahl - for doing much of the internal overhaul work of Mesa for 2.0
  909. Frank Ortega - for bug fixes and many helpful comments
  910. Mats Lofkvist - for finding a number of bugs in Mesa 2.0
  911. Charlie Wallace - for the MS-DOS driver
  912. Li Wei - for updated Windows 95/NT driver
  913. Pete French - for the OpenStep driver
  914. Tinic Uro - for the BeOS driver
  915. Daniel Barrero - for the 3-D texture mapping extension
  916. Randy Frank - for many bug reports/fixes and code contributions
  917.  
  918.  
  919. This file last revised:  March 13, 1997
  920.